package org.example;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    //属性注入
//    @Autowired
    private UserService userService;

    //构造方法注入
    @Autowired
    public UserController(){
        this.userService=new UserService();
    }


    //setter方法注入
    public User getUser(){
        return userService.userOp();
    }
}
